package com.example.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.example.common.R;
import com.example.model.resp.ListCategoryResp;
import com.example.service.CategoryService;

@ResponseBody
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    // 在管理员界面获取所有的分类
    @GetMapping("/admin/list")
    public R<List<ListCategoryResp>> getCategoryList() {
        return categoryService.getCategoryList();
    }
}
